package com.efast.dmom.mes.bean;

import java.util.ArrayList;
import java.util.List;

import com.efast.dmom.mes.bean.base.ConfigurationBaseBean;
import com.efast.dmom.mes.datahandlers.entity.ShiftDataHandler;
import com.efast.dmom.mes.entity.WorkingCalendarEntity;

public class WorkingCalendar extends ConfigurationBaseBean<WorkingCalendarEntity> {
	

	private static final long serialVersionUID = -7038270513128326954L;
	
	private List<WorkingCalendarShift> workingCalendarShift;

	public List<WorkingCalendarShift> getWorkingCalendarShift() {
		return workingCalendarShift;
	}

	public void setWorkingCalendarShift(List<WorkingCalendarShift> workingCalendarShift) {
		this.workingCalendarShift = workingCalendarShift;
	}
	
	public List<Shift> getShifts() {
		List<Shift> listShits = new ArrayList<Shift>();
		List<WorkingCalendarShift> workingCalendarShifts = getWorkingCalendarShift();
		for(WorkingCalendarShift wcs:workingCalendarShifts) {
			Shift shift = getService(ShiftDataHandler.class).getById(wcs.getInnerData().getShiftId());
			listShits.add(shift);
		}
		
		return listShits;
		
	}


}
